import pygame
import modGame

pygame.init()
screen_size = (800, 600)
screen = pygame.display.set_mode(screen_size)

keep_going = True

timer = pygame.time.Clock()
margin = 8

jets3 = [modGame.Jet(), modGame.Jet(), modGame.Jet()] # 三架飞机
jetW = jets3[0].width
jetL = jets3[0].length
# 第一架飞机居中
jetX = (screen.get_width() - jetW) / 2 # 水平居中
jetY = screen.get_height() - margin - jetL # 垂直靠底部
jets3[0].SetPositon(jetX, jetY) # 设定飞机的初始位置
# 第二架飞机偏左
jets3[1].SetPositon(jetX - jetW - margin, jetY)
# 第三架架飞机偏右
jets3[2].SetPositon(jetX + jetW + margin, jetY)

while keep_going:
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            keep_going = False
    
    screen.fill((0, 0, 0))
    # 飞机
    for jet in jets3:
        jet.render(screen)

    pygame.display.update()
    timer.tick(60)

pygame.quit()